<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link rel="stylesheet" type="text/css" href="/misc/css/base.css"  />
<link rel="stylesheet" type="text/css" href="/misc/css/btnicon.css"  />
<link rel="stylesheet" type="text/css" href="/misc/css/reset_admin.css"  />
<link rel="stylesheet" type="text/css" href="/misc/css/adminmenu.css"  />
<link rel="stylesheet" type="text/css" href="/misc/css/newadmin.css"  />
<script type="text/javascript" src="/misc/vendors/jquery/jquery_1.2.6.js"></script>
<script type="text/javascript" src="/misc/vendors/o2js/o2js.js"></script>
<script type="text/javascript" src="/misc/vendors/o2js/o2js_build.js"></script>
<script type="text/javascript" >
var baseUrl = "<?=$themeUrl?>";
$().ready(function(){



});
var grids;
</script>
</head>
<body   style="background-color:#fcfcfc"> 
<script type="text/javascript">
var url_save = '<?=url::build('admin_ku','update',array('reqtype'=>'json'))?>'; 

$().ready(function(){  
	showLoading();   
   $('#nums').focus();
});
/* 保存 */
function fnSave(){
	var form = serializeObj("#myform");

	/* 一些验证 */
	if($.trim(form.nums) == '' || !fnRegExp('reg_int1',form.nums) || form.nums<0){
		alert('请输入正确的【当前库存量】，需要大于等于0的整数');
		$('#nums').focus();
		return false;
	}
	if($.trim(form.yuns) == '' || !fnRegExp('reg_int1',form.yuns) || form.yuns<0){
		alert('请输入正确的【在途采购量】，需要大于等于0的整数');
		$('#yuns').focus();
		return false;
	} 
  $('button').attr('disabled','disabled');
	$.ajax({
		async:true,
		type:'post',
		url:url_save,
		data:{
			form:JSON.encode(form) 
		},
		success:function(e){
  		$('button').attr('disabled','');
			var ok = errorHandler(e);
			if(ok){　 
				<?PHP
				if(isset($_GET['endfunc'])){
					echo 'parent.'.$_GET['endfunc'].'(ok);';
				}
				?>
				fnReturn();
			}
		}
	});
}
/* 返回 */
function fnReturn(){
	if(defined(parent) && defined(parent.ymPrompt)){
		parent.ymPrompt.close();
	}else{
		window.close();
	}
}
</script>
<style type="text/css">
.numyun{
width:60px;
font-size:18px;
color:#FF3300;
text-align:right;
padding:3px;
}
.spanshu{
color:#00CC33;font-size:18px;
width:50px;
display:block;
float:left;
}
</style>
<div style="margin:10px;color:#333333;font-size:14px;font-weight:bold">
	更新库存
</div>
<form id="myform" action="" method="post" onsubmit="return false" >
<div style="margin:10px;">
	<div class="blockdiv">
		<div class="titlediv">菜品信息</div>
		<table class="mytable" > 
			<tr>
				<td class="mylabel"> 菜品类别：</td>
				<td class="myinfo" > 
					{$rs.type_name}
				</td>  
			</tr> 
			<tr>
				<td class="mylabel">菜品名称：</td>
				<td class="myinfo" > 
					{$rs.name}
					<input type="hidden" id="id" name="id" value="{$rs.id}" />
				</td>  
			</tr> 
			<tr>
				<td class="mylabel">当前库存量（份）：</td>
				<td class="myinfo"  >
					<span class="spanshu"  >{$rs.nums}</span> 
					&nbsp;&nbsp;&nbsp;&nbsp;
					<span style="color:#999999;">更新为</span> 
					 <input type="text" id="nums" name="nums" class="numyun" value="{$rs.nums}" />
				</td>  
			</tr>  
			<tr>
				<td class="mylabel">在途采购量（份）：</td>
				<td class="myinfo">
					<span class="spanshu">{$rs.yuns}</span> 
					&nbsp;&nbsp;&nbsp;&nbsp;
					<span style="color:#999999;">更新为</span> 
					 <input type="text" id="yuns" name="yuns" class="numyun"  value="{$rs.yuns}" />
				</td>  
			</tr>  
		</table> 
	</div>
</div>
</form>
<div  class="button_div">
		<button class=" " onclick="fnSave()">保 存</button>
		<span class="gray">或</span> 
		<a href="#" onclick="fnReturn()">取 消</a>
</div> 
</body>
</html>